<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<header th:fragment="commonHeader">
    <script rel="stylesheet" th:src="@{/static/common/js/bootstrap.min.js}"></script>
    <script rel="stylesheet" th:src="@{/static/common/js/popper.min.js}" ></script>
    <script rel="stylesheet" th:src="@{/static/common/js/plugins/pace.min.js}" ></script>
    <link rel="stylesheet" th:href="@{/static/common/css/main-vali.css}">
    <script th:inline="javascript">
        function keyLogin(){
            if (event.keyCode==13){
                document.getElementById("submit_btn").click(); //调用登录按钮的登录事件
            }
        }
        if (window != top){
            top.location.href = location.href;
        }
        var basePath = [[${#servletContext.contextPath}]];
        $(function () {
            $('.login-content [data-toggle="flip"]').click(function() {
                $('.login-box').toggleClass('flipped');
                return false;
            });
            $(".submit-btn").click(function (e) {
                $.post(basePath+"/login",$(".login-form").serializeArray(),function (data) {
                    if (data.success){
                        window.location.href = basePath+"/index";
                    }else{
                        toastr.warning(data.message);
                    }
                })
            })
        })
    </script>
</header>
</html>